using System;
using System.Collections.Generic;

using TnPlus.Entities.Utils;
using TnPlus.Entities.Models;
using TnPlus.DAL;
using TnPlus.Common;

namespace TnPlus.Biz
{
	public class DebtHistoryService
	{
		/// <summary>
		/// Saves a record to the DebtHistory table.
		/// </summary>
		public virtual void Insert(DebtHistoryInfo debtHistoryInfo)
		{
			try
			{
				new DebtHistoryDAO().Insert(debtHistoryInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.DebtHistory - Insert", ex);
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the DebtHistory table.
		/// </summary>
		public virtual void Update(DebtHistoryInfo debtHistoryInfo)
		{
			try
			{
				new DebtHistoryDAO().Update(debtHistoryInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.DebtHistory - Update", ex);
				throw;
			}

		}

		/// <summary>
		/// Delete a record from the DebtHistory table.
		/// </summary>
		public virtual void Delete(Guid? idDebt)
		{
			try
			{
				new DebtHistoryDAO().Delete(idDebt);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.DebtHistory - Delete", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects a single record from the DebtHistory table.
		/// </summary>
		public virtual DebtHistoryInfo Select(Guid? idDebt)
		{
			try
			{
				return new DebtHistoryDAO().Select(idDebt);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.DebtHistory - Select", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects all records from the DebtHistory table.
		/// </summary>
		public List<DebtHistoryInfo> SelectAll()
		{
			try
			{
				return new DebtHistoryDAO().SelectAll();
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.DebtHistory - SelectAll", ex);
				throw;
			}

		}

	}
}
